import { prop, modelOptions, Ref, arrayProp } from '@typegoose/typegoose' 
import { ApiProperty } from '@nestjs/swagger' 
import { Works } from './works.model' 

@modelOptions({
    schemaOptions: {
        timestamps: true
    }
})
export class Personage {
    @prop()
    @ApiProperty({ description: '姓名' })
    name: string

    @prop()
    @ApiProperty({ description: '头像' })
    portrait: string

    @prop()
    @ApiProperty({ description: '综述' })
    introduce: string

    @prop({ref: 'Works'})
    @ApiProperty({ description: '作品' })
    works: Ref<Works>[]
}